#define _CRT_SECURE_NO_WARNINGS
#include"shared.h"
class Date
{
public:
	~Date()
	{
		cout << "~Date()" << endl;
	}
	Date(size_t year = 1, size_t month = 1, size_t day = 1)
	{
		_year = year;
		_month = month;
		_day = day;
	}
private:
	size_t _year;
	size_t _month;
	size_t _day;

};
template<class T>
struct DeleteArray
{
	void operator()(T* ptr)
	{
		delete[] ptr;
	}
};
//
//void fun(Date* ptr)
//{
//	delete[] ptr;
//}
int main() 
{
	//DeleteArray<Date> dele;

	//Date* p = new Date[10];
	//function<void(Date* ptr)> _del = dele;
	//_del(p);


	//unique_ptr<Date> D1(new Date);
	//unique_ptr<Date, DeleteArray<Date>> D2(new Date[5]);
	//unique_ptr<Date[]> D1(new Date[5]);
	My_shared::shared_ptr<Date> D1(new Date);
	My_shared::shared_ptr<Date> D2(new Date[5], DeleteArray<Date>());
	//My_shared::shared_ptr<Date> D2(D1);
	//My_shared::shared_ptr<Date> D3(new Date);
	//D3 = D3;

	return 0;
}